/* Sidebar Overlay */
/* Overlay behind sidebar to dim background */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Prevent clicks when hidden */
    transition: opacity 0.2s ease, visibility 0.2s ease;
    will-change: opacity, visibility;
    z-index: 9999; /* Below sidebar but above other UI */
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Block background clicks when visible */
}

/* Sidebar Styles */
/* Sidebar panel container and slide-in behavior */
.sidebar {
    position: fixed;
    top: 0;
    left: 0; /* Anchor to left edge */
    width: 300px;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    transform: translateX(-100%); /* Hidden off-screen */
    transition: transform 0.22s ease-out;
    will-change: transform;
    z-index: 10000; /* Ensure above overlay and all UI */
    padding-top: 100px;
    overflow-y: auto;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35); /* Subtle drop shadow */
}

.sidebar.active {
    transform: translateX(0); /* Slide in from left */
}

/* Inner sidebar content padding */
.sidebar-content {
    padding: 20px;
}

/* Sidebar category link styling */
.frame-category {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.frame-category:hover {
    background-color: rgba(255, 255, 255, 0.1);
    padding-left: 30px;
}

.frame-category:last-child {
    border-bottom: none;
}

/* Main content shift when sidebar is open */
.main-content {
    transition: margin-left 0.3s ease;
    margin-left: 0;
}

.main-content.shifted {
    margin-left: 300px;
}

/* Responsive Sidebar — phones */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        padding-top: 80px;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
        transition: transform 0.18s ease-out; /* faster animation on phones */
        backdrop-filter: none; /* remove heavy blur for smoother performance */
    }
    .sidebar-content {
        padding: 16px;
    }
    .frame-category {
        font-size: 17px;
        padding: 14px 18px;
    }
    .main-content.shifted {
        margin-left: 0; /* No horizontal shift on small screens */
    }
}